<template>
  <div class="form-select">
    <a-select
      :value="value"
      v-bind="this.$attrs"
      v-on="$listeners"
      @change="handleChange"
    >
      <a-select-option v-for="option in options" :key="option.value">{{ option.key }}</a-select-option>
    </a-select>
  </div>
</template>

<script>
export default {
  name: 'form-select',
  props: {
    value: {
      type: [String, Number],
      default: ''
    },
    options: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    handleChange (val) {
      this.$emit('input', val)
    }
  }
}
</script>

<style scoped lang='less'>
.form-select {
  .ant-select {
    width: 100%;
  }
}

</style>
